package com.ndphu.comic.gui.fragment.searchbook;

import android.content.Intent;
import android.support.v4.app.Fragment;

import com.ndphu.comic.gui.activity.MainActivity;
import com.ndphu.comic.gui.activity.OnlineBook;
import com.ndphu.comic.gui.list.model.SearchBookItem;

public abstract class AbstractSearchBookFragment extends Fragment implements ISearchBook {

	@Override
	public Intent createOpenBookIntent(SearchBookItem item) {
		Intent intent = new Intent(getActivity(), OnlineBook.class);
		intent.putExtra(MainActivity.EXTRA_BOOK_URL, item.bookLink);
		intent.putExtra(MainActivity.EXTRA_BOOK_NAME, item.bookName);
		intent.putExtra(MainActivity.EXTRA_BOOK_COVER_URL, item.bookCoverLink);
		intent.putExtra(MainActivity.EXTRA_BOOK_SOURCE, item.bookSource);
		return intent;
	}

}
